package org.dtrd.modules.device.entity.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.dtrd.modules.device.config.DeviceConstant;

/**
 * @author 萧
 * @date:2021-11-07 3:38 下午
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "设备信息")
public class DeviceInfo {

    private boolean enable;

    @ApiModelProperty(value = "设备图标")
    private String deviceIcon;

    @ApiModelProperty(value = "设备名称，不包含血压计、血糖仪字段", example = "小糖医")
    private String deviceName;

    @ApiModelProperty(value = "设备描述")
    private String deviceDescribe;

    /**
     * {@link DeviceConstant.DeviceBrand}
     */
    @ApiModelProperty(value = "设备品牌")
    private int deviceBrand;

    @ApiModelProperty(value = "条码二维码限制位数，为空则无需校验")
    private Integer qrcodeLength;

    /**
     * {@link DeviceConstant.DeviceCategory}
     */
    @ApiModelProperty(value = "设备种类")
    private int deviceCategory;

    @ApiModelProperty(value = "设备序列号")
    private String deviceSn;

    @ApiModelProperty(value = "关联服务包ID")
    private Integer packageId;

    public DeviceInfo(String deviceIcon, String deviceName, String deviceDescribe) {
        this.deviceIcon = deviceIcon;
        this.deviceName = deviceName;
        this.deviceDescribe = deviceDescribe;
    }

    public DeviceInfo(boolean enable, String deviceIcon, String deviceName, String deviceDescribe, int deviceBrand, Integer qrcodeLength, int deviceCategory, String deviceSn) {
        this.enable = enable;
        this.deviceIcon = deviceIcon;
        this.deviceName = deviceName;
        this.deviceDescribe = deviceDescribe;
        this.deviceBrand = deviceBrand;
        this.qrcodeLength = qrcodeLength;
        this.deviceCategory = deviceCategory;
        this.deviceSn = deviceSn;
    }
}
